package www.lagou.app;

import org.junit.Test;
import www.lagou.dao.PhoneDao;
import www.lagou.entity.Phone;

import java.sql.SQLException;
import java.util.List;

public class PhoneDaoTest {
    PhoneDao phoneDao=new PhoneDao();
    //getPhoneByPrice
    @Test
    public void testGetPhoneByPrice() throws SQLException {

        List<Phone> phoneList=phoneDao.getPhoneByPrice(2000,"2019");
        System.out.println("查询价格高于2000元，生产日期是2019年之前的所有手机的是：");
        for(Phone phone:phoneList){
            System.out.println(phone);
        }
    }
    //getPhoneByColor
    @Test
    public void testGetPhoneColor() throws SQLException {
            List<Phone> phoneList=phoneDao.getPhoneByColor("白色");
              System.out.println("查询所有颜色是白色的手机信息是:");
            for (Phone phone:phoneList){
                System.out.println("白色是："+phone);
            }
    }


}
